<?

	CO_authority( );

	$JO[ "guide"	] = JO( array( "EN" => "Guide"		, "KO" => "안내"	, "VI" => "Guide"		) );
	$JO[ "record"	] = JO( array( "EN" => "Record"		, "KO" => "기록"	, "VI" => "Record"		) );

	$JO[ "date"		] = JO( array( "EN" => "Date"		, "KO" => "일자"	, "VI" => "Date"		) );
	$JO[ "subject"	] = JO( array( "EN" => "Subject"	, "KO" => "제목"	, "VI" => "Subject"		) );
	$JO[ "sender"	] = JO( array( "EN" => "Sender"		, "KO" => "발신자"	, "VI" => "Sender"		) );
	$JO[ "receiver"	] = JO( array( "EN" => "Receiver"	, "KO" => "수신자"	, "VI" => "Receiver"	) );

	$CO[ "question"	] = JO( array( "EN" => "Question"	, "KO" => "질의"	, "VI" => "Question"	) );
	$CO[ "request"	] = JO( array( "EN" => "Request"	, "KO" => "요청"	, "VI" => "Request"		) );
	$CO[ "notice"	] = JO( array( "EN" => "Notice"		, "KO" => "고지"	, "VI" => "Notice"		) );
	$CO[ "report"	] = JO( array( "EN" => "Report"		, "KO" => "보고"	, "VI" => "Report"		) );

	$CO[ "post"		] = JO( array( "EN" => "Post"		, "KO" => "우편"	, "VI" => "Post"		) );
	$CO[ "mail"		] = JO( array( "EN" => "Mail"		, "KO" => "메일"	, "VI" => "Mail"		) );

?>



<div class="JO_bar_720">

	<h1><?= $JO[ "attornment" ] ?> <?= $JO[ "guide" ] ?></h1>

	<div>

		<? if(	$_SESSION[ "JO_account_language"	] == "EN"				||
				$_SESSION[ "JO_account_authority"	] == "administrator"	||
				$_SESSION[ "JO_account_authority"	] == "observer"			||
				$_SESSION[ "JO_account_authority"	] == "SO"				) { ?>

		<? } ?>

		<? if(	$_SESSION[ "JO_account_language"	] == "KO"				||
				$_SESSION[ "JO_account_authority"	] == "administrator"	||
				$_SESSION[ "JO_account_authority"	] == "observer"			||
				$_SESSION[ "JO_account_authority"	] == "SO"				) { ?>

				폐사의 콘텐트 유통 계약서 양식은 베트남 내 콘텐트 권리 침해 단속 법무 대행에 관한 내용을 포함하고 있습니다.<br />

				폐사는 그 관련 진행 사항을 본 페이지를 통하여 귀사와 공유합니다.<br />

				귀사가 별도의 법무 대행을 필요로 하실 경우 '<a href="10_contact" class="JO_positive">문의</a>' 메뉴 또는 메일 <a href="mailto:jay@neowiz.vn" class="JO_positive">jay@neowiz.vn</a>로 요청 부탁 드립니다.

		<? } ?>

		<? if(	$_SESSION[ "JO_account_language"	] == "VI"				||
				$_SESSION[ "JO_account_authority"	] == "administrator"	||
				$_SESSION[ "JO_account_authority"	] == "observer"			||
				$_SESSION[ "JO_account_authority"	] == "SO"				) { ?>	

		<? } ?>

		<hr />

	</div>

</div>



<div class="JO_bar_720">

	<h1><?= $JO[ "attornment" ] ?> <?= $JO[ "record" ] ?></h1>

	<div>

		<table>

			<tr>
				<th style="width: 65px;"	><?= $JO[ "date"		] ?></th>
				<th							><?= $JO[ "subject"		] ?></th>
				<th							><?= $JO[ "sender"		] ?></th>
				<th							><?= $JO[ "receiver"	] ?></th>
			</tr>

			<?

				$query = "
					SELECT	( SELECT `name` FROM `organization` WHERE `key` = `sender`		) AS `sender FKF`,
							( SELECT `name` FROM `organization` WHERE `key` = `receiver`	) AS `receiver FKF`,
							`type`,
							`method`,
							`subject`,
							`content`,
							`file`,
							`insert`
					FROM	`attornment`
					WHERE	`delete` IS NULL
				";

				if(	$_SESSION[ "JO_account_authority" ] != "administrator"	&&
					$_SESSION[ "JO_account_authority" ] != "observer"		&&
					$_SESSION[ "JO_account_authority" ] != "SO"				) $query .= " 
						AND	`organization` = '" . $_SESSION[ "JO_account_organization" ] . "'
					";

					$recordSet = JO_query( $query );

					if( $recordSet -> num_rows ) while( $record = $recordSet -> fetch_array( ) ) {

			?>

				<tr>

					<td><?= JO_date( $record[ "insert" ] ) ?></td>

					<td <?= $record[ "content" ] ? "title='" . $record[ "content" ] . "'" : "" ?>>

						<a href="CO_81_file_contract/<?= $record[ "file" ] ?>" target="_blank"><?= $record[ "subject" ] ? $record[ "subject" ] : $CO[ $record[ "type" ] ] . " " . $CO[ $record[ "method" ] ] ?></a>

					</td>

					<td><?= $record[ "sender FKF"	] ?></td>
					<td><?= $record[ "receiver FKF" ] ?></td>

				</tr>

			<? } else { ?>

				<tr>
					<td colspan="4" class="JO_center">...</td>
				</tr>

			<? } ?>



		</table>

	</div>

</div>



<? /*

	질의 우편	= question post
	질의 메일	= question mail
	요청 우편	= request post
	요쳥 메일	= request mail
	통보 우편	= notice post
	통보 메일	= notice mail
	보고		= report
	비고		= note

	열람 시 내용, 이미지, .pdf 등 제공

*/ ?>
